import math
import time
def addFun():
    print("*"*10)
    print("@"*10)
    return 8

print(id(addFun))
print(type(addFun))
for i in range(10):
    y = addFun()
    print(y)

def printMax(a,b):
    '''
            较大值
            fffd
            '''
    if a > b:

        print(a,"较大值")
    else:
        print(b,"较大值")
printMax(10,20)
help(printMax.__doc__)

#测试局部变量、全局变量的效率
def test01():
    start = time.time()
    for i in range(10000000):
        math.sqrt(30)
    end = time.time()
    print("耗时{0}".format(end-start))

def test02():
    b=math.sqrt
    start = time.time()
    for i in range(10000000):
        b(30)
    end = time.time()
    print("耗时{0}".format(end-start))
test01()
test02()

b=[10,20]
def f2(m):
    print("m:",id(m))
    m.append(30)
f2(b)
print("b:",id(b))
print(b)

# 传递不可变对象的引用
a =100
def f3(n):
    print("n:",id(n))
    n = n+20
    print("n:",id(n))
    print(n)
f3(a)
print("a:",id(a))
